package com.csce.domain.entity.score;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.doudou.core.date.DateUtil;
import com.osce.common.annotation.Excel;
import com.osce.common.core.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 考试分配学员对象 score_ex_exam_place_allot
 *
 * @author zzx
 * @since 2023-09-07
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
@Builder
@ToString
@EqualsAndHashCode(callSuper = true)
public class ScoreExExamPlaceAllot extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @ApiModelProperty("${comment}")
    private Long id;

    /**
     * 考试编号
     */
    @Excel(name = "考试编号")
    @ApiModelProperty("考试编号")
    private Long examId;

    /**
     * 考试场次编号
     */
    @Excel(name = "考试场次编号")
    @ApiModelProperty("考试场次编号")
    private Long sessionId;

    /**
     * 真实考试用户编号
     */
    @Excel(name = "真实考试用户编号")
    @ApiModelProperty("真实考试用户编号")
    private Long exUserId;
    /**
     * 用户编号
     */
    @Excel(name = "用户编号")
    @ApiModelProperty("用户编号")
    private Long userId;
    private String userName;

    /**
     * 考试评分表
     */
    @Excel(name = "考试评分表")
    @ApiModelProperty("考试评分表")
    private Long sheetId;
    private String sheetName;

    /**
     * 代号
     */
    @Excel(name = "代号")
    @ApiModelProperty("代号")
    private String code;

    /**
     * 开始考试时间
     */
    @JsonFormat(pattern = "HH:mm:ss")
    @ApiModelProperty("开始考试时间")
    private Date startTime;

    /**
     * 结束考试时间
     */
    @JsonFormat(pattern = "HH:mm:ss")
    @ApiModelProperty("结束考试时间")
    private Date endTime;

    /**
     * 状态
     */
    @Excel(name = "状态")
    @ApiModelProperty("状态")
    private Integer status;

    /**
     * 预留字段1 打分时间
     */
    @Excel(name = "预留字段1")
    @ApiModelProperty("预留字段1")
    private String reservedOne;

    /**
     * 预留字段2 老师评语
     */
    @Excel(name = "预留字段2")
    @ApiModelProperty("预留字段2")
    private String reservedTwo;

    /**
     * 总分
     */
    private BigDecimal total;


    public String getStartTimeStr() {
        return DateUtil.formatTime(this.startTime);
    }


    public String getEndTimeStr() {
        return DateUtil.formatTime(this.endTime);
    }


}
